<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<html>
  <head>
    <title>Users</title>
	<link href="<s:url value="/css/admin.css"/>" rel="stylesheet" type="text/css">
	<s:head/>
  </head>
  
 <body>
	<s:if test="%{action=='update'}">
		<s:url action="updateuser" id="actionurl"/>
	</s:if>
	<s:else>
		<s:url action="saveuser" id="actionurl"/>
	</s:else>
 <s:form action="%{actionurl}" method="post">
 <s:hidden name="action"/>
 <s:hidden name="user.userid"/>
 <s:hidden name="user.userDetail.userid"/>
	<center>
	  <b>Users</b>
	</center><br>
	<table width="50%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><s:actionerror/><s:fielderror/> </td>
  </tr>
</table>
	<table width="70%"  border="0" align="center" cellpadding="0" cellspacing="0"  style="border-collapse:collapse ">
  <tr>
    <td width="25%" height="25" align="right">Name:</td>
    <td width="75%">
    	<s:textfield name="user.name"/>
    </td>
  </tr>
   <tr>
    <td width="25%" height="25" align="right">password:</td>
    <td width="75%">
    	<s:textfield name="user.password" value="111111"/>
    </td>
  </tr>
    <tr>
    <td width="25%" height="25" align="right">Sex:</td>
    <td width="75%">
    	<s:radio list="@com.debug.config.Constant@SEX_MAP" name="user.sex"/>
    </td>
  </tr>
    <tr>
    <td width="25%" height="25" align="right">Title:</td>
    <td width="75%">
    	<s:textfield name="user.title"/>
    </td>
  </tr>
  <tr>
    <td height="25" align="right">Department:</td>
    <td><s:select list="departmentList" listKey="deptCode" listValue="name" headerKey="" headerValue="[select a dept]" name="user.department"/> </td>
  </tr>
  <tr>
    <td height="25" align="right">Type:</td>
    <td><s:select list="@com.debug.config.Constant@USER_TYPE_MAP" headerKey="-1" headerValue="[select a type]" name="user.type"/> </td>
  </tr>
  <tr>
    <td height="25" align="right">Telephone:</td>
    <td><s:textfield name="user.userDetail.tel"/> </td>
  </tr>
  <tr>
    <td height="25" align="right">Email:</td>
    <td><s:textfield name="user.userDetail.email"/> </td>
  </tr>
  <tr>
    <td height="25" align="right">Memo:</td>
    <td><s:textarea name="user.userDetail.memo" rows="8" cols="50"/> </td>
  </tr>
</table>
<br>
<table width="15%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="center">
    <td width="53%"><input type="submit" name="Submit" value=" Submit"></td>
    <td width="47%"><input type="reset" name="Submit2" value=" Reset"></td>
  </tr>
</table>
</s:form>
</body>
</html>
